const express = require("express");
const config = require("../config");
const router = express.Router();

router.post("/connect", (req, res) => {
  if (config.config.password && req.body.password !== config.config.password) {
    return res.send({
      status: 1,
      message: "密码错误",
    });
  }
  res.send({
    status: 0,
    message: "连接成功",
  });
});


router.post("/turn", (req, res) => {
  if (config.config.password && req.body.password !== config.config.password) {
    return res.send({
      status: 1,
      message: "密码错误",
    });
  }
  res.send({
    status: 0,
    message: config.config.turn,
  });
});

module.exports = router;
